<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of qtt_mg_interp</title>
  <meta name="keywords" content="qtt_mg_interp">
  <meta name="description" content="The simplest multigrid operator in QTT as a TT-matrix">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html v1.5 &copy; 2003-2005 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../../m2html.css">
</head>
<body>
<a name="_top"></a>
<div><a href="../../index.html">Home</a> &gt;  <a href="#">tt2</a> &gt; <a href="index.html">misc</a> &gt; qtt_mg_interp.m</div>

<!--<table width="100%"><tr><td align="left"><a href="../../index.html"><img alt="<" border="0" src="../../left.png">&nbsp;Master index</a></td>
<td align="right"><a href="index.html">Index for tt2/misc&nbsp;<img alt=">" border="0" src="../../right.png"></a></td></tr></table>-->

<h1>qtt_mg_interp
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>The simplest multigrid operator in QTT as a TT-matrix</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="box"><strong>function [m]=qtt_mg_interp(d) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre class="comment">The simplest multigrid operator in QTT as a TT-matrix
   [M]=QTT_MG_INTERP(D) Computes the simplest MG-operator in the
   QTT-format on 2^D grid. Its stencil is
 1,    0
 0.5,    0.5
 0,    1
 0,    0.5


 TT-Toolbox 2.2, 2009-2012

This is TT Toolbox, written by Ivan Oseledets et al.
Institute of Numerical Mathematics, Moscow, Russia
webpage: http://spring.inm.ras.ru/osel

For all questions, bugs and suggestions please mail
ivan.oseledets@gmail.com
---------------------------</pre></div>

<!-- crossreference -->
<h2><a name="_cross"></a>CROSS-REFERENCE INFORMATION <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
This function calls:
<ul style="list-style-image:url(../../matlabicon.gif)">
<li><a href="../../tt2/@tt_matrix/tt_matrix.html" class="code" title="function t = tt_matrix(varargin)">tt_matrix</a>	TT_matrix class constructor</li></ul>
This function is called by:
<ul style="list-style-image:url(../../matlabicon.gif)">
</ul>
<!-- crossreference -->



<h2><a name="_source"></a>SOURCE CODE <a href="#_top"><img alt="^" border="0" src="../../up.png"></a></h2>
<div class="fragment"><pre>0001 <a name="_sub0" href="#_subfunctions" class="code">function [m]=qtt_mg_interp(d)</a>
0002 <span class="comment">%The simplest multigrid operator in QTT as a TT-matrix</span>
0003 <span class="comment">%   [M]=QTT_MG_INTERP(D) Computes the simplest MG-operator in the</span>
0004 <span class="comment">%   QTT-format on 2^D grid. Its stencil is</span>
0005 <span class="comment">% 1,    0</span>
0006 <span class="comment">% 0.5,    0.5</span>
0007 <span class="comment">% 0,    1</span>
0008 <span class="comment">% 0,    0.5</span>
0009 <span class="comment">%</span>
0010 <span class="comment">%</span>
0011 <span class="comment">% TT-Toolbox 2.2, 2009-2012</span>
0012 <span class="comment">%</span>
0013 <span class="comment">%This is TT Toolbox, written by Ivan Oseledets et al.</span>
0014 <span class="comment">%Institute of Numerical Mathematics, Moscow, Russia</span>
0015 <span class="comment">%webpage: http://spring.inm.ras.ru/osel</span>
0016 <span class="comment">%</span>
0017 <span class="comment">%For all questions, bugs and suggestions please mail</span>
0018 <span class="comment">%ivan.oseledets@gmail.com</span>
0019 <span class="comment">%---------------------------</span>
0020 
0021 
0022 prol0 = [1 0; 0.5 0.5; 0 1; 0 0.5];
0023 h0 = [0 0; 0 0; 0 0; 0.5 0];
0024 I = eye(2);
0025 I12 = [0 1; 0 0];
0026 I21 = [0 0; 1 0];
0027 
0028 m = cell(d,1);
0029 
0030 m{1}=zeros(4,2,2);
0031 m{1}(:,:,1)=prol0; m{1}(:,:,2)=h0;
0032 <span class="keyword">for</span> i=2:d-1
0033     m{i}=zeros(2,2,2,2);
0034     m{i}(:,:,1,1)=I;
0035     m{i}(:,:,2,1)=I12; m{i}(:,:,2,2)=I21;
0036 <span class="keyword">end</span>; 
0037 m{d} = zeros(2,2,2);
0038 m{d}(:,:,1)=I; m{d}(:,:,2)=I12;
0039 
0040 m = <a href="../../tt2/@tt_matrix/tt_matrix.html" class="code" title="function t = tt_matrix(varargin)">tt_matrix</a>(m);
0041 
0042 <span class="keyword">end</span></pre></div>
<hr><address>Generated on Wed 08-Feb-2012 18:20:24 by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" title="Matlab Documentation in HTML">m2html</a></strong> &copy; 2005</address>
</body>
</html>